import { defineStore } from 'pinia';

interface TestState {
    t_number : number,
    t_string : string
}

export const useTestStore = defineStore({
  id: 'test_store',
  state: (): TestState => ({
    //数字类型
    t_number: 0,
    //字符串
    t_string : ''

  }),
  getters: {
    getTNumber(): number {
      return this.t_number
    },
    getTString() : string {
      return this.t_string
    }
  },
  actions: {
    setTNumber(tNmuber: number) {
      console.log("tNumber----",tNmuber);
      this.t_number = tNmuber; 
    },
    setTString(tString: string){
        this.t_string = tString;
    }
  },
});

